STEP 3: Let's create a function that will calculate how much the T-rex and kitten would weigh on the moon!

A float is a number with a decimal point. Floats are a data type used in Python, like integers or strings.

  • Go to LOGIC and then and drag out Define Function with Parameters.
  • Change the name of the function to get_moon_weight.
  • Go to and drag Float Variable inside the function. It should have a ···· in front of it.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)